-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
horizon/ingest: support parsing of new InvokeHostFunction op #4608
horizon/ingest: support parsing of new InvokeHostFunction op #4608
Conversation
services/horizon/internal/integration/invokehostfunction_test.go
Outdated
Show resolved
Hide resolved
…vokehostfunction_support
…ct, debugging function_trapped
services/horizon/internal/integration/invokehostfunction_test.go
Outdated
Show resolved
Hide resolved
services/horizon/internal/integration/invokehostfunction_test.go
Outdated
Show resolved
Hide resolved
54df7f6
to
940db2e
Compare
services/horizon/internal/ingest/processors/stats_ledger_transaction_processor.go
Outdated
Show resolved
Hide resolved
func submitInvokeHostFunction(itest *integration.Test, tt *assert.Assertions) (submittedOperations []txnbuild.Operation, lastLedger int32) { | ||
ops := []txnbuild.Operation{ | ||
&txnbuild.InvokeHostFunction{ | ||
Function: xdr.HostFunctionHostFnCall, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these values be populated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this test coverage, success/fail of tx was not scope for assertion, rather, it's just the presence of the InvokeHostFunction xdr going through ingest, so tried to avoid further complexity on that.
services/horizon/internal/ingest/processors/operations_processor.go
Outdated
Show resolved
Hide resolved
services/horizon/internal/ingest/processors/operations_processor.go
Outdated
Show resolved
Hide resolved
services/horizon/internal/ingest/processors/stats_ledger_transaction_processor.go
Outdated
Show resolved
Hide resolved
services/horizon/internal/integration/invokehostfunction_test.go
Outdated
Show resolved
Hide resolved
if raw, err := param.MarshalBinary(); err == nil { | ||
serializedParam["value"] = base64.StdEncoding.EncodeToString(raw) | ||
} | ||
params = append(params, serializedParam) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any case where we want to add a serializedParam here that doesn't have a value ?
i.e. that's what going to happen in case MarshalBinary
would return an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there shouldn't be based on type safety of the gen'd xdr structs, but rather than ignore the runtime serialization error
in any case, I've done some conservative err handling and test coverage of that exceptional case of a malformed param - 68a1d74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small comments, but looks good otherwise!
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
Adding support in ingest and on api resource model for new InvokeHostFunction operation.
Adding test coverage on tx submit for InvokeHostFunction.
Why
Closes #4604
Known limitations